<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function fn(age){
            if(age< 18){
                throw new Error('年龄不能小于18岁');
            }
            else if(age>60){
                // throw new Error('年龄不能大于60岁');
                throw new SyntaxError('语法有问题')
            }

            console.log('年龄是'+age,'可以进入愉快的玩游戏');
        }

        fn(88);
    </script>
</body>
</html>